projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
435ed31
)
imcontext: Fix cursor positions
author
Matthias Clasen
<mclasen@redhat.com>
Wed, 21 Apr 2021 10:27:26 +0000
(06:27 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Wed, 21 Apr 2021 10:28:52 +0000
(06:28 -0400)
gtk_im_context_get_preedit_string is documented to
return the cursor position as a character offset,
not a byte count. So return that.
Fixed: #3885
gtk/gtkimcontextsimple.c
patch
|
blob
|
history
diff --git
a/gtk/gtkimcontextsimple.c
b/gtk/gtkimcontextsimple.c
index a3a2c54c8f4306888ca3e194b6e5f48b602e5162..074ffdd01f98048f4bc2ec9a1796d24b575f8b14 100644
(file)
--- a/
gtk/gtkimcontextsimple.c
+++ b/
gtk/gtkimcontextsimple.c
@@
-1152,7
+1152,7
@@
gtk_im_context_simple_get_preedit_string (GtkIMContext *context,
}
if (cursor_pos)
- *cursor_pos =
s->len
;
+ *cursor_pos =
g_utf8_strlen (s->str, s->len)
;
if (attrs)
{